using System.Collections.Generic;
using Newtonsoft.Json;

namespace CPlatePrintSys.Domain.Models
{
    /// <summary>
    /// 布局信息模型
    /// </summary>
    public class LayoutInfo
    {
        /// <summary>
        /// 布局方式：1-镜像，2-合并
        /// </summary>
        [JsonProperty("LayoutMean")]
        public string LayoutMean { get; set; }

        /// <summary>
        /// 镜像布局信息
        /// </summary>
        [JsonProperty("Mirrored")]
        public MirroredLayout Mirrored { get; set; }

        /// <summary>
        /// 合并布局信息
        /// </summary>
        [JsonProperty("Merged")]
        public MergedLayout Merged { get; set; }
    }

    /// <summary>
    /// 镜像布局信息
    /// </summary>
    public class MirroredLayout
    {
        /// <summary>
        /// 原始对象编号
        /// </summary>
        [JsonProperty("OriginalObjNo")]
        public string OriginalObjNo { get; set; }

        /// <summary>
        /// 镜像对象编号
        /// </summary>
        [JsonProperty("MirrorObjNo")]
        public string MirrorObjNo { get; set; }
    }

    /// <summary>
    /// 合并布局信息
    /// </summary>
    public class MergedLayout
    {
        /// <summary>
        /// 钢板长度
        /// </summary>
        [JsonProperty("SheetLongth")]
        public double SheetLongth { get; set; }

        /// <summary>
        /// 钢板宽度
        /// </summary>
        [JsonProperty("SheetWidth")]
        public double SheetWidth { get; set; }

        /// <summary>
        /// 零件布局列表
        /// </summary>
        [JsonProperty("PartLayouts")]
        public List<PartLayout> PartLayouts { get; set; } = new List<PartLayout>();
    }

    /// <summary>
    /// 零件布局信息
    /// </summary>
    public class PartLayout
    {
        /// <summary>
        /// 钢板一贯编号
        /// </summary>
        [JsonProperty("SheetConsistentNo")]
        public string SheetConsistentNo { get; set; }

        /// <summary>
        /// 位置信息
        /// </summary>
        [JsonProperty("Position")]
        public Position Position { get; set; }

        /// <summary>
        /// 旋转角度（度）
        /// </summary>
        [JsonProperty("Rotation")]
        public double Rotation { get; set; } = 0;

        /// <summary>
        /// 文件路径
        /// </summary>
        [JsonProperty("FilePath")]
        public string FilePath { get; set; } = "";
    }

    /// <summary>
    /// 位置信息
    /// </summary>
    public class Position
    {
        /// <summary>
        /// X坐标
        /// </summary>
        [JsonProperty("X")]
        public double X { get; set; }

        /// <summary>
        /// Y坐标
        /// </summary>
        [JsonProperty("Y")]
        public double Y { get; set; }
    }
} 